# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.WalletObjects.V1.Model.TicketLeg do
  @moduledoc """


  ## Attributes

  *   `arrivalDateTime` (*type:* `String.t`, *default:* `nil`) - The date/time of arrival. This is an ISO 8601 extended format date/time, with or without an offset. Time may be specified up to nanosecond precision. Offsets may be specified with seconds precision (even though offset seconds is not part of ISO 8601). For example: `1985-04-12T23:20:50.52Z` would be 20 minutes and 50.52 seconds after the 23rd hour of April 12th, 1985 in UTC. `1985-04-12T19:20:50.52-04:00` would be 20 minutes and 50.52 seconds after the 19th hour of April 12th, 1985, 4 hours before UTC (same instant in time as the above example). If the event were in New York, this would be the equivalent of Eastern Daylight Time (EDT). Remember that offset varies in regions that observe Daylight Saving Time (or Summer Time), depending on the time of the year. `1985-04-12T19:20:50.52` would be 20 minutes and 50.52 seconds after the 19th hour of April 12th, 1985 with no offset information. The portion of the date/time without the offset is considered the "local date/time". This should be the local date/time at the destination station. For example, if the event occurs at the 20th hour of June 5th, 2018 at the destination station, the local date/time portion should be `2018-06-05T20:00:00`. If the local date/time at the destination station is 4 hours before UTC, an offset of `-04:00` may be appended. Without offset information, some rich features may not be available.
  *   `carriage` (*type:* `String.t`, *default:* `nil`) - The train or ship name/number that the passsenger needs to board.
  *   `departureDateTime` (*type:* `String.t`, *default:* `nil`) - The date/time of departure. This is required if there is no validity time interval set on the transit object. This is an ISO 8601 extended format date/time, with or without an offset. Time may be specified up to nanosecond precision. Offsets may be specified with seconds precision (even though offset seconds is not part of ISO 8601). For example: `1985-04-12T23:20:50.52Z` would be 20 minutes and 50.52 seconds after the 23rd hour of April 12th, 1985 in UTC. `1985-04-12T19:20:50.52-04:00` would be 20 minutes and 50.52 seconds after the 19th hour of April 12th, 1985, 4 hours before UTC (same instant in time as the above example). If the event were in New York, this would be the equivalent of Eastern Daylight Time (EDT). Remember that offset varies in regions that observe Daylight Saving Time (or Summer Time), depending on the time of the year. `1985-04-12T19:20:50.52` would be 20 minutes and 50.52 seconds after the 19th hour of April 12th, 1985 with no offset information. The portion of the date/time without the offset is considered the "local date/time". This should be the local date/time at the origin station. For example, if the departure occurs at the 20th hour of June 5th, 2018 at the origin station, the local date/time portion should be `2018-06-05T20:00:00`. If the local date/time at the origin station is 4 hours before UTC, an offset of `-04:00` may be appended. Without offset information, some rich features may not be available.
  *   `destinationName` (*type:* `GoogleApi.WalletObjects.V1.Model.LocalizedString.t`, *default:* `nil`) - The destination name.
  *   `destinationStationCode` (*type:* `String.t`, *default:* `nil`) - The destination station code.
  *   `fareName` (*type:* `GoogleApi.WalletObjects.V1.Model.LocalizedString.t`, *default:* `nil`) - Short description/name of the fare for this leg of travel. Eg "Anytime Single Use".
  *   `originName` (*type:* `GoogleApi.WalletObjects.V1.Model.LocalizedString.t`, *default:* `nil`) - The name of the origin station. This is required if `desinationName` is present or if `originStationCode` is not present.
  *   `originStationCode` (*type:* `String.t`, *default:* `nil`) - The origin station code. This is required if `destinationStationCode` is present or if `originName` is not present.
  *   `platform` (*type:* `String.t`, *default:* `nil`) - The platform or gate where the passenger can board the carriage.
  *   `ticketSeat` (*type:* `GoogleApi.WalletObjects.V1.Model.TicketSeat.t`, *default:* `nil`) - The reserved seat for the passenger(s). If more than one seat is to be specified then use the `ticketSeats` field instead. Both `ticketSeat` and `ticketSeats` may not be set.
  *   `ticketSeats` (*type:* `list(GoogleApi.WalletObjects.V1.Model.TicketSeat.t)`, *default:* `nil`) - The reserved seat for the passenger(s). If only one seat is to be specified then use the `ticketSeat` field instead. Both `ticketSeat` and `ticketSeats` may not be set.
  *   `transitOperatorName` (*type:* `GoogleApi.WalletObjects.V1.Model.LocalizedString.t`, *default:* `nil`) - The name of the transit operator that is operating this leg of a trip.
  *   `transitTerminusName` (*type:* `GoogleApi.WalletObjects.V1.Model.LocalizedString.t`, *default:* `nil`) - Terminus station or destination of the train/bus/etc.
  *   `zone` (*type:* `String.t`, *default:* `nil`) - The zone of boarding within the platform.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :arrivalDateTime => String.t() | nil,
          :carriage => String.t() | nil,
          :departureDateTime => String.t() | nil,
          :destinationName => GoogleApi.WalletObjects.V1.Model.LocalizedString.t() | nil,
          :destinationStationCode => String.t() | nil,
          :fareName => GoogleApi.WalletObjects.V1.Model.LocalizedString.t() | nil,
          :originName => GoogleApi.WalletObjects.V1.Model.LocalizedString.t() | nil,
          :originStationCode => String.t() | nil,
          :platform => String.t() | nil,
          :ticketSeat => GoogleApi.WalletObjects.V1.Model.TicketSeat.t() | nil,
          :ticketSeats => list(GoogleApi.WalletObjects.V1.Model.TicketSeat.t()) | nil,
          :transitOperatorName => GoogleApi.WalletObjects.V1.Model.LocalizedString.t() | nil,
          :transitTerminusName => GoogleApi.WalletObjects.V1.Model.LocalizedString.t() | nil,
          :zone => String.t() | nil
        }

  field(:arrivalDateTime)
  field(:carriage)
  field(:departureDateTime)
  field(:destinationName, as: GoogleApi.WalletObjects.V1.Model.LocalizedString)
  field(:destinationStationCode)
  field(:fareName, as: GoogleApi.WalletObjects.V1.Model.LocalizedString)
  field(:originName, as: GoogleApi.WalletObjects.V1.Model.LocalizedString)
  field(:originStationCode)
  field(:platform)
  field(:ticketSeat, as: GoogleApi.WalletObjects.V1.Model.TicketSeat)
  field(:ticketSeats, as: GoogleApi.WalletObjects.V1.Model.TicketSeat, type: :list)
  field(:transitOperatorName, as: GoogleApi.WalletObjects.V1.Model.LocalizedString)
  field(:transitTerminusName, as: GoogleApi.WalletObjects.V1.Model.LocalizedString)
  field(:zone)
end

defimpl Poison.Decoder, for: GoogleApi.WalletObjects.V1.Model.TicketLeg do
  def decode(value, options) do
    GoogleApi.WalletObjects.V1.Model.TicketLeg.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.WalletObjects.V1.Model.TicketLeg do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
